package test;

import org.junit.Test;
import redis.clients.jedis.Jedis;

public class testredis {
    @Test
    public void redis(){
        //连接
        Jedis jedis=new Jedis("127.0.0.1",6379);
        //执行操作
        jedis.set("username","xiaom");

        String username = jedis.get("username");
        System.out.println(username);
        jedis.del("username");
        System.out.println(username);

        //关闭连接
        jedis.close();
    }
}
